<template>
  <div class="container">
    <div class="search">
      <div class="search-item">
        <div class="search-title"> 关键字 </div>
        <a-input allowClear v-model:value.trim="params.keyword" placeholder="用户名/手机号/所在公司" @search="search"
          style="width: 260px;margin-right: 0px;" />
      </div>
      <div>
        <a-button type="primary" style="margin-right: 10px;">搜索</a-button>
        <a-button type="primary" style="margin-right: 10px;">重置</a-button>
      </div>

    </div>
    <div class="table-box">
      <a-table :pagination="false" :columns="columns" :data-source="listData">
        <template #bodyCell="{ column, record }">
          <template v-if="column.key == 'status'">
            <span>{{ record.status == 0 ? '正常' : '锁定' }}</span>
          </template>
          <template v-if="column.key == 'action'">
            <a-button type="link" @click="toDetail(record)" style="padding: 0 2px">详情</a-button>
          </template>
        </template>
      </a-table>
      <!-- @change="onChange" -->
      <a-pagination :show-total="total => `总共${total} 条`" style="float: right;margin: 20px 0;"
        v-model:page-size="filterData.pageSize" v-model:current="filterData.pageNum" :total="total"
        show-quick-jumper></a-pagination>
    </div>
    <!-- 授权 -->
    <!-- :rules="rules" -->
    <a-modal :maskClosable="false" title="详情" v-model:open="modalVisible">

    </a-modal>
  </div>
</template>
<script>
import { logList, } from "@/api/log";


export default {
  data() {
    return {

      modalVisible: false,
      params: {
        keyword: ''
      },
      filterData: {
        pageSize: 1,
        pageNum: 10,
      },
      total: 0,
      columns: [
        { title: "用户名", dataIndex: "userName", key: "userName", align: "center" },
        { title: "操作时间", dataIndex: "time", key: "time", align: "center" },
        { title: "操作结果", dataIndex: "result", key: "result", align: "center" },
        {
          title: "操作",
          // width: 80,
          fixed: "right",
          align: "center",
          dataIndex: "action", key: "action",
        },

      ],
      listData: [
        {
          userId: 1,
          userName: 'zhangsan',
          realName: '张三',
          phone: '1333333333',
          role: '作业员',
          status: 0,
          time: '2025-10-29 14:46',
          result: '进行了编辑种植图层'
        },
        {
          userId: 1,
          userName: 'zhangsan',
          realName: '张三',
          phone: '1333333333',
          role: '作业员',
          status: 0,
          time: '2025-10-29 14:46',
          result: '登录了系统'
        },


      ],

    }
  },
  components: {},
  computed: {

  },
  mounted() {

    // this.getLogList()

  },
  methods: {
    search() {

    },
    getLogList() {
      logList(this.filterData)
        .then((res) => {
          console.log(res, 8888);
          if (res.code == 200) {
            this.listData = res.data
            this.total = res.total
          }
        })
        .catch(() => { });
    },
    // onChange(e) {
    //   this.filterData.pageNum = e
    //   this.getUserList()
    // },


  }
}
</script>


<style scoped lang="less">
.container {
  height: 100%;
  overflow: auto;

  .search {
    display: flex;
    flex-wrap: wrap;

    .search-item {
      margin: 0 15px 15px 0;
      font-size: 16px;
      display: flex;
      align-items: center;

      .search-title {
        font-size: 15px;
        color: #333333;
        margin-right: 10px;
        font-weight: 400;

      }
    }
  }



  .table-box {}
}
</style>
